using System;

namespace Velocity4Net.Runtime.ResourceManage
{

    /// <summary> 
    /// Class to manage the text resource for the Velocity
    /// Runtime.
    /// </summary>
    public struct ResourceManager_Fields
    {
        public const int RESOURCE_TEMPLATE = 1;
        public const int RESOURCE_CONTENT = 2;
    }
    /**
     * Class to manage the text resource for the Velocity
     * Runtime.
     *
     * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
     * @author <a href="mailto:paulo.gaspar@krankikom.de">Paulo Gaspar</a>
     * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
     * @version $Id: ResourceManager.java 898050 2010-01-11 20:15:31Z nbubna $
     */
    public interface ResourceManager
    {

        /**
         * Initialize the ResourceManager.
         * @param rs
         */
        void Initialize(RuntimeServices rs);

        /**
         * Gets the named resource.  Returned class type corresponds to specified type
         * (i.e. <code>Template</code> to <code>RESOURCE_TEMPLATE</code>).
         *
         * @param resourceName The name of the resource to retrieve.
         * @param resourceType The type of resource (<code>RESOURCE_TEMPLATE</code>,
         *                     <code>RESOURCE_CONTENT</code>, etc.).
         * @param encoding  The character encoding to use.
         * @return Resource with the template parsed and ready.
         * @throws ResourceNotFoundException if template not found
         *          from any available source.
         * @throws ParseErrorException if template cannot be parsed due
         *          to syntax (or other) error.
         */
        Resource GetResource(String resourceName, int resourceType, String encoding);

        /**
         *  Determines is a template exists, and returns name of the loader that
         *  provides it.  This is a slightly less hokey way to support
         *  the Velocity.templateExists() utility method, which was broken
         *  when per-template encoding was introduced.  We can revisit this.
         *
         *  @param resourceName Name of template or content resource
         *  @return class name of loader than can provide it
         */
        String GetLoaderNameForResource(String resourceName);

    }
}
